package com.parksys.controller;

import com.parksys.common.JsonResult;
import com.parksys.service.PositionService;
import com.parksys.util.JsonUtil;
import com.parksys.vo.Position;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @auther longfei
 * @date 2020/9/15 21:37
 * @Version 1.0
 */
@RestController
@Api(tags = "用户相关的操作！")
public class PositionController {
    @Autowired
    private PositionService positionService;

    @GetMapping("/findP.do")
    @ApiOperation(value = "查询登记过的车牌", notes = "车牌")
    public List<Position> findP (Integer pid) {
        return  positionService.findP(pid);
    }
    @GetMapping("/addP.do")
    @ApiOperation(value = "添加车辆", notes = "车")
    public JsonResult addP(Integer pid) {
        positionService.addP(pid);
        return JsonUtil.creatJsonResult(1,"添加成功");
    }
}
